#include <bits/stdc++.h>
using namespace std;

inline int get_num() {
	int k = 0;
	char c = getchar();
	for(; !isdigit(c); c = getchar());
	for(; isdigit(c); c = getchar()) k = k * 10 + c - '0';
	return k;
}

struct bignum{
	int s[400];
	bignum() {
		memset(s, 0, sizeof(s));
	}
	inline void insert(int a) {
		memset(s, 0, sizeof(s));
		int i = 0;
		while(a) {
			s[i++] = a % 10;
			a /= 10;
		}
	}
	inline void prt() {
		int l = 399;
		while(!s[l] && l) l--;
		do{
			printf("%d", s[l]);
		} while(l--);
	}
	
}D[233];

inline bignum operator + (const bignum &a, const bignum &b) {
	bignum c;
	for(int i = 0; i <= 400; i++) {
		c.s[i] += a.s[i] + b.s[i];
		c.s[i + 1] += c.s[i] / 10;
		c.s[i] %= 10;
	}
	return c;
}

inline bignum operator * (int a, bignum b) {
	for(int i = 0; i <= 400; i++) b.s[i] *= a;
	for(int i = 0; i <= 400; i++) {
		b.s[i + 1] += b.s[i] / 10;
		b.s[i] %= 10;
	}
	return b;
}

int main() {
	freopen("chess_2016.in", "r", stdin);
	freopen("chess_2016.out", "w", stdout);
	int n = get_num();
	D[1].insert(0);
	D[2].insert(1);
	for(int i = 3; i <= n; i++) {
		D[i] = (i - 1) * (D[i - 2] + D[i - 1]);
	}
	D[n].prt();
	return 0;
} 
